home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / Internet / NewsWatch Folder / headers / TCPHi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-03  |  4.9 KB  |  107 lines  |  [TEXT/MPS ]

  1. #ifndef _TCPLOW_
  2. #define _TCPLOW_
  3.  
  4. /* amimated cursor stuff -------------------------------------------------------*/
  5.  
  6. void InitNetCursor(void);        /* gets the network acur resource                    */
  7. void TrashNetCursor(void);        /* releases the network acur resource                */
  8.  
  9.  
  10. /* network initialization ------------------------------------------------------*/
  11.  
  12. OSErr InitNetwork(void);        /* opens the network driver */
  13.  
  14.  
  15. /* connection stream creation/removal -------------------------------------------*/
  16.  
  17. OSErr CreateStream(                /* creates a stream needed to establish a connection*/
  18.     unsigned long *stream,            /* stream identifier (returned)                    */
  19.     unsigned long recvLen);            /* stream buffer length to be allocated            */
  20.     
  21. OSErr ReleaseStream(            /* disposes of an unused stream and its buffers        */
  22.     unsigned long stream);            /* stream identifier to dispose                    */
  23.  
  24.  
  25. /* connection opening/closing calls ---------------------------------------------*/
  26.  
  27. OSErr OpenConnection(            /* attempts to establish a connection w/remote host */
  28.     unsigned long stream,            /* stream id to be used for connection            */
  29.     long remoteHost,                /* network number of remote host                */
  30.     short remotePort,                /* network port of remote port                    */
  31.     Byte timeout);                    /* timeout value for connection                    */
  32.     
  33. OSErr WaitForConnection(        /* listens for a remote connection from a rem. port */
  34.     unsigned long stream,            /* stream id to be used for connection            */
  35.     Byte timeout,                    /* timeout value for open                        */
  36.     short localPort,                /* local port to listen on                        */
  37.     long *remoteHost,                /* remote host connected to (returned)            */
  38.     short *remotePort);                /* remote port connected to (returned)            */
  39.  
  40. void AsyncWaitForConnection(    /* same as above, except executed asynchronously    */
  41.     unsigned long stream,            /* stream id to be used for connection            */
  42.     Byte timeout,                    /* timeout value for open                        */
  43.     short localPort,                /* local port to listen on                        */
  44.     long remoteHost,                /* remote host to listen for                    */
  45.     short remotePort,                /* remote port to listen for                    */
  46.     TCPiopb **returnBlock);            /* parameter block for call (returned)            */
  47.  
  48. OSErr AsyncGetConnectionData(    /* retrieves connection data for above call            */
  49.     TCPiopb *returnBlock,            /* parameter block for asyncwait call            */
  50.     long *remoteHost,                /* remote host connected to (returned)            */
  51.     short *remotePort);                /* remote port connected to (returned)            */
  52.  
  53. OSErr CloseConnection(            /* closes an established connection                    */
  54.     unsigned long stream);            /* stream id of stream used for connection        */
  55.     
  56. OSErr AbortConnection(            /* aborts a connection non-gracefully                */
  57.     unsigned long stream);            /* stream id of stream used for connection        */
  58.  
  59.  
  60. /* data sending calls ----------------------------------------------------------*/
  61.  
  62. OSErr SendData(                    /* sends data along an open connection                */
  63.     unsigned long stream,            /* stream used for connection                    */
  64.     Ptr data,                        /* pointer to data to send                        */
  65.     unsigned short length,            /* length of data to send                        */
  66.     Boolean retry);                    /* if true, call continues until send successful*/
  67.     
  68. OSErr SendMultiData(            /* sends multiple strings of data on a connection    */
  69.     unsigned long stream,            /* stream used for connection                    */
  70.     Str255 data[],                    /* array of send strings                        */    
  71.     short numData,                    /* number of strings to send                    */
  72.     Boolean retry);                    /* if true, call continues until send successful*/
  73.  
  74. void SendDataAsync(                /* sends data asynchronously                        */
  75.     unsigned long stream,            /* stream used for connection                    */
  76.     Ptr data,                        /* pointer to data to send                        */
  77.     unsigned short length,            /* length of data to send                        */
  78.     TCPiopb **returnBlock);            /* pointer to parameter block (returned)        */
  79.     
  80. OSErr SendAsyncDone(            /* called when SendDataAsync call completes            */
  81.     TCPiopb *returnBlock);            /* parameter block to complete connection        */
  82.  
  83.  
  84. /* data receiving calls --------------------------------------------------------*/
  85.  
  86. OSErr RecvData(                    /* waits for data to be received on a connection    */
  87.     unsigned long stream,            /* stream used for connection                    */ 
  88.     Ptr data,                        /* pointer to memory used to hold incoming data    */
  89.     unsigned short *length,            /* length to data received (returned)            */
  90.     Boolean retry);                    /* if true, call continues until successful        */
  91.     
  92. void RecvDataAsync(                /* receives data asynchronously                        */
  93.     unsigned long stream,            /* stream used for connection                    */
  94.     Ptr data,                        /* pointer to memory used to hold incoming data    */
  95.     unsigned short length,            /* length of data requested                        */
  96.     TCPiopb **returnBlock);            /* parameter block to complete connection        */
  97.     
  98. OSErr GetDataLength(            /* called when RecvDataAsync completes                */
  99.     TCPiopb *returnBlock,            /* parameter block used for receive                */
  100.     unsigned short *length);        /* length of data received (returned)            */
  101.  
  102.  
  103. /* status callback routine ------------------------------------------------------*/
  104.  
  105. void StatusProc(char *status);    /* status procedure used in FTP callbacks */
  106.  
  107. #endif _TCPLOW_